import request from "@/utils/trademark/request";

export interface AttrList {
  id?: number | string | undefined;
  tmName: string;
  logoUrl: string;
}
export type AttrListData = {
  records: AttrList[];
  total: number;
  size: number;
  current: number;
  searchCount: boolean;
  pages: number;
};
export default {
  //分页
  getPageListInfo(page: number, limit: number) {
    return request.get<any, AttrListData>(
      `/admin/product/baseTrademark/${page}/${limit}`
    );
  },
  //添加或修改
  addOrUpdate(attr: AttrList) {
    if (attr.id) {
      return request.put<any, null>(
        "/admin/product/baseTrademark/update",
        attr
      );
    } else {
      return request.post<any, null>("/admin/product/baseTrademark/save", attr);
    }
  },
  //删除
  remove(id: number) {
    return request.delete<any, null>(
      `/admin/product/baseTrademark/remove/${id}`
    );
  },
};
